package com.mdxq.mall.sale.service.impl;

import com.mdxq.mall.sale.entity.HomeBrand;
import com.mdxq.mall.sale.mapper.HomeBrandMapper;
import com.mdxq.mall.sale.service.HomeBrandService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 首页推荐品牌表 服务层实现。
 *
 * @author ShuJie
 * @since 2025-01-12
 */
@Service
public class HomeBrandServiceImpl extends ServiceImpl<HomeBrandMapper, HomeBrand>  implements HomeBrandService{

    @Override
    @Transactional
    public boolean updateRecommendStatus(String ids, Integer recommendStatus) {
        for(String id:ids.split(",")){
            HomeBrand homeBrand=getById(id);
            homeBrand.setRecommendStatus(recommendStatus);
            updateById(homeBrand);
        }
        return true;
    }
}
